# -*- mode: snippet -*-
# name: getprimesv1
# key: getprimesv1
# --
const int N = 100010;
int primes[N], cnt;
bool st[N];

void get_primes(int n) {
  for (int i = 2; i <= n; ++i) {
    if (!st[i]) {
      primes[cnt++] = i;
      for (int j = i + i; j <= n; j += i) {
        st[j] = true;
      }
    }
  }
}
